import cv2,math,os,time
capture = cv2.VideoCapture("test.mp4")
count = capture.get(cv2.CAP_PROP_FRAME_COUNT)
height_=20
width_=40
list_=[[[0 for x in range(width_)] for y in range(height_)] for z in range(int(count))]
index=0
while(True):
    ret, frame = capture.read()
    if ret is True:
        res = cv2.resize(frame,(width_, height_))
        res=cv2.cvtColor(res,cv2.COLOR_BGR2GRAY)
        for i in range(height_):
            for j in range(width_):
                if(int(res[i,j])>165):#165可以换0-255的数，165最合适
                    list_[index][i][j]='  '
                else:
                    list_[index][i][j]='GG'
        index=index+1
    else:
        break
index=0
while True:
    for a in range(height_):
        for b in range(width_):
            print(list_[index][a][b],end='')
        print('\n')
    time.sleep(1/35)#速度（可调）
    index=index+1

#代码八年级小盆友瞎写的勿喷
